<?php
declare (strict_types=1);

use think\facade\Route;

/**
 * 后台管理(iot)
 */
Route::group('iot', function () {
    //前缀
    $namespace = '\app\admin\controller\iot';

    //取袋路径配置
    Route::post('scanBagImageUpload$', $namespace . '\ScanBag@imageUpload')->name('取袋路径图片上传');
    Route::get('scanBagThirdAll$', $namespace . '\ScanBag@thirdAll')->name('取袋路径聚合平台');
    Route::get('scanBagList$', $namespace . '\ScanBag@list')->name('取袋路径配置列表');
    Route::put('scanBagAdd$', $namespace . '\ScanBag@add')->name('取袋路径配置新增');
    Route::put('scanBagEdit$', $namespace . '\ScanBag@edit')->name('取袋路径配置编辑');
    Route::get('scanBagDeviceList$', $namespace . '\ScanBag@deviceList')->name('取袋路径设备列表');
    Route::get('AdvertiserTaskDeviceList$', $namespace . '\ScanBag@AdvertiserTaskDeviceList')->name('推广任务设备列表');
    Route::post('scanBagAddDevice$', $namespace . '\ScanBag@addDevice')->name('取袋路径添加设备');
    Route::post('scanBagImportDevice$', $namespace . '\ScanBag@importDevice')->name('取袋路径导入设备');
    Route::post('advertiserTaskImportDevice$', $namespace . '\ScanBag@importTaskDevice')->name('取袋路径导入设备');
    Route::delete('scanBagDelDevice$', $namespace . '\ScanBag@delDevice')->name('取袋路径删除设备');
    Route::delete('advertiserTaskDelDevice$', $namespace . '\ScanBag@delAdvertiserTaskIDevice')->name('推广任务删除设备');
    //出袋策略配置
    Route::put('scanBagStrategyAdd$', $namespace . '\ScanBagStrategy@add')->name('出袋策略新增');
    Route::put('scanBagStrategyEdit', $namespace . '\ScanBagStrategy@edit')->name('出袋策略编辑');
    Route::get('scanBagStrategyList$', $namespace . '\ScanBagStrategy@list')->name('出袋策略列表');
    Route::post('scanBagStrategyAddDevice$', $namespace . '\ScanBagStrategy@addDevice')->name('出袋策略添加设备');
    Route::post('scanBagStrategyImportDevice$', $namespace . '\ScanBagStrategy@importDevice')->name('出袋策略导入设备');
    Route::delete('scanBagStrategyDelDevice$', $namespace . '\ScanBagStrategy@delDevice')->name('出袋策略删除设备');
    Route::get('scanBagStrategyDeviceList$', $namespace . '\ScanBagStrategy@deviceList')->name('出袋策略设备列表');
    //设备管理
    Route::get('deviceTypeAll$', $namespace . '\Device@deviceTypeAll')->name('获取所有设备类型');
    Route::get('warehouseList$', $namespace . '\Device@warehouseList')->name('终端仓库列表');
    Route::get('deviceList$', $namespace . '\Device@deviceList')->name('设备列表');
    Route::get('deviceLogList$', $namespace . '\Device@deviceLogList')->name('设备通信日志列表');
    Route::get('deviceListExport$', $namespace . '\Device@deviceListExport')->name('设备列表导出');
    //设备命令
    Route::post('deviceShippingOrder$', $namespace . '\Device@shippingOrder')->name('出货事件');
    Route::post('deviceMotorDeliveryLength$', $namespace . '\Device@motorDeliveryLength')->name('电机出货长度事件');
    Route::post('deviceAllowanceQuery$', $namespace . '\Device@allowanceQuery')->name('余量查询事件');
    Route::post('deviceTimingSwitch$', $namespace . '\Device@timingSwitch')->name('定时开关机事件');
    Route::post('deviceVolumeSet$', $namespace . '\Device@volumeSet')->name('音量调整事件');
    Route::post('deviceRestart$', $namespace . '\Device@deviceRestart')->name('设备重启事件');
    Route::post('deviceLogCat$', $namespace . '\Device@deviceLogCat')->name('设备日志开关');
    //APK管理
    Route::get('deviceApkList$', $namespace . '\DeviceApk@deviceApkList')->name('设备APK列表');
    Route::post('deviceApkUpload$', $namespace . '\DeviceApk@deviceApkUpload')->name('设备APK上传');
    Route::post('deviceApkAdd$', $namespace . '\DeviceApk@deviceApkAdd')->name('设备APK添加');
    Route::delete('deviceApkDel$', $namespace . '\DeviceApk@deviceApkDel')->name('设备APK删除');
    Route::put('deviceApkStatus$', $namespace . '\DeviceApk@deviceApkStatus')->name('设备APK上下架');
    Route::post('deviceApkRelease$', $namespace . '\DeviceApk@deviceApkRelease')->name('设备APK发布');
    Route::get('deviceApkLogList$', $namespace . '\DeviceApk@deviceApkLogList')->name('设备APK日志列表');
    //积分任务
    Route::put('integralTaskAdd$', $namespace . '\IntegralTask@add')->name('积分任务新增');
    Route::post('integralTaskEdit$', $namespace . '\IntegralTask@edit')->name('积分任务新增');
    Route::get('integralTaskList$', $namespace . '\IntegralTask@list')->name('积分任务列表');
    Route::get('integralTaskEnable$', $namespace . '\IntegralTask@taskEnable')->name('积分任务上下架');
    Route::get('MatterList$', $namespace . '\IntegralTask@MatterList')->name('获取推广物列表');
    Route::get('taskStatistics$', $namespace . '\IntegralTask@taskStatistics')->name('积分任务完成统计');

})->middleware(middleware\AuthMiddleware::class, 'admin');

Route::group('iot', function () {
    //前缀
    $namespace = '\app\admin\controller\iot';
    Route::get('deviceRestarts$', $namespace . '\Device@deviceRestarts')->name('手动批量重启');
});


/**
 * 设备管理对客户端接口(iot)
 */
Route::group('iot', function () {
    //前缀
    $namespace = '\app\admin\controller\iot';
    //设备系统v2和v1信息同步
    Route::post('deviceRegister$', $namespace . '\DeviceSyn@deviceRegister')->name('设备注册');
    Route::post('deviceMqttError$', $namespace . '\DeviceSyn@deviceMqttError')->name('设备Mqtt异常上报');
    Route::post('deviceInstallNotice$', $namespace . '\DeviceSyn@deviceInstallNotice')->name('设备安装成功通知');
    Route::post('deviceDismantleNotice$', $namespace . '\DeviceSyn@deviceDismantleNotice')->name('设备拆除成功通知');
    Route::post('deviceRestartV1$', $namespace . '\DeviceSyn@deviceRestart')->name('设备重启事件');
    Route::post('deviceVolumeSetV1$', $namespace . '\DeviceSyn@volumeSet')->name('音量调整事件');
    Route::post('deviceTimingSwitchV1$', $namespace . '\DeviceSyn@timingSwitch')->name('定时开关机事件');
    Route::post('deviceMotorDeliveryLengthV1$', $namespace . '\DeviceSyn@motorDeliveryLength')->name('电机出货长度事件');
});




